{extend name="web/public/base" /}
{block name="header"}
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading font-bold">{$title}</header>
                <div class="panel-body">
                    <form id="ajaxform" action="{:url('addOredit')}" role="form" method="post" onsubmit="return false;">
                        <div class="row col-md-10">
                            <div class="row col-lg-12">
                                <div class="form-group col-sm-6">
                                    <label>名称</label>
                                    <input type="text" name="name" class="form-control" placeholder="名称"
                                           value="{$row_info['name']|default=''}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>直推数量</label>
                                    <input type="text" name="num" class="form-control" placeholder="直推数量"
                                           value="{$row_info['num']|default=''}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>消费包类型</label>
                                    <select name="package_id" class="form-control">
                                        <option value="0"> 无</option>
                                        {foreach name="packages" item="vo"}
                                        <option value="{$vo.id}"> {$vo.name}</option>
                                        {/foreach}
                                    </select>
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>联盟成长值</label>
                                    <input type="text" name="growth" class="form-control" placeholder="联盟成长值"
                                           value="{$row_info['growth']|default=''}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>总成长值</label>
                                    <input type="text" name="total_growth" class="form-control" placeholder="总成长值"
                                           value="{$row_info['total_growth']|default=''}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>分红比例</label>
                                    <input type="text" name="divid_rate" class="form-control" placeholder="分红比例"
                                           value="{$row_info['divid_rate']|default=''}">
                                </div>

                                <div class="form-group col-sm-6">
                                    <label>贡献值释放比例</label><br>
                                    <input type="text" name="contribution_release_rate" class="form-control" placeholder="贡献值释放比例"
                                           value="{$row_info['contribution_release_rate']|default=0}" style="display: inline-block;width: 60%;margin-right: 10px">%
                                </div>

                                <div class="form-group col-sm-6">
                                    <label>活跃值兑换通兑宝扣费比例</label><br>
                                    <input type="text" name="active_tdb_rate" class="form-control" placeholder="活跃值兑换通兑宝扣费比例"
                                           value="{$row_info['active_tdb_rate']|default=0}" style="display: inline-block;width: 60%;margin-right: 10px">%
                                </div>

                            </div>
                            <footer class="panel-footer text-right bg-light lter col-sm-12">
                                <input type="hidden" name="id" value="{$row_info.id|default=''}">
                                <button type="submit" class="btn btn-success btn-s-xs">提 交</button>
                            </footer>
                        </div>
                    </form>
                </div>
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $.validator.setDefaults({
            submitHandler: function () {
                ajaxSubmit();
            },
            highlight: function (element, errorClass) {
                $(element).css('border', '2px solid red');
            },
            unhighlight: function (element, errorClass) {
                $(element).css('border', '1px solid green');
            }
        });

        $('#ajaxform').validate({
            rules: {
                title: "required",
                container: "required"
            },
            messages: {
                title: "请输入文章标题",
                container: "请输入文章内容"
            }
        });
    })
</script>
{/block}
